API
Enviar Link de Onboarding
POST
/
messaging
/
api
/
v1
/
services
/
onboarding-link
Enviar Link de Onboarding
curl --request POST \
--url https://api.valid.com/messaging/api/v1/services/onboarding-link \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"channel": "<string>",
"contact": "<string>",
"companyName": "<string>",
"link": "<string>"
}
'import requests
url = "https://api.valid.com/messaging/api/v1/services/onboarding-link"
payload = {
"channel": "<string>",
"contact": "<string>",
"companyName": "<string>",
"link": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: '<string>',
contact: '<string>',
companyName: '<string>',
link: '<string>'
})
};
fetch('https://api.valid.com/messaging/api/v1/services/onboarding-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valid.com/messaging/api/v1/services/onboarding-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => '<string>',
'contact' => '<string>',
'companyName' => '<string>',
'link' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valid.com/messaging/api/v1/services/onboarding-link"
payload := strings.NewReader("{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valid.com/messaging/api/v1/services/onboarding-link")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/messaging/api/v1/services/onboarding-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "01a150cd-3fbb-710e-889a-4de55ca8d739",
"status": "SENT"
}
{
"code": "VALIDATION_ERROR",
"message": "Input validation failed",
"details": [
{ "field": "link", "message": "link must be an https URL" }
]
}
{
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
A rota
POST /messaging/api/v1/services/onboarding-link envia à pessoa o seu link para ela completar a identificação. O envio pode ser por WhatsApp, SMS ou e-mail.
- A mensagem mostra o nome da sua empresa e leva a pessoa até o seu link.
- No WhatsApp, a pessoa abre o link por um botão na mensagem.
- O link enviado vale por 30 dias.
Request Body
string
required
Canal de envio:
whatsapp, sms ou email.Exemplo: whatsappstring
required
Telefone da pessoa (canais
whatsapp e sms), com o código do país e o DDD. Ou e-mail da pessoa (canal email), com até 254 caracteres.Exemplo: +5511999999999string
required
Nome da sua empresa. Ele aparece na mensagem. Até 64 caracteres, sem link, quebra de linha, tab ou 4 espaços seguidos.Exemplo:
Banco Xstring
required
O seu link, para onde a pessoa vai. Só
https, com até 2048 caracteres.Exemplo: https://www.suaempresa.com.br/cadastro/12345Response
string
Identificador da mensagem.
string
SENT: a mensagem foi aceita para envio.{
"id": "01a150cd-3fbb-710e-889a-4de55ca8d739",
"status": "SENT"
}
{
"code": "VALIDATION_ERROR",
"message": "Input validation failed",
"details": [
{ "field": "link", "message": "link must be an https URL" }
]
}
{
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
⌘I
Enviar Link de Onboarding
curl --request POST \
--url https://api.valid.com/messaging/api/v1/services/onboarding-link \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"channel": "<string>",
"contact": "<string>",
"companyName": "<string>",
"link": "<string>"
}
'import requests
url = "https://api.valid.com/messaging/api/v1/services/onboarding-link"
payload = {
"channel": "<string>",
"contact": "<string>",
"companyName": "<string>",
"link": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: '<string>',
contact: '<string>',
companyName: '<string>',
link: '<string>'
})
};
fetch('https://api.valid.com/messaging/api/v1/services/onboarding-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valid.com/messaging/api/v1/services/onboarding-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => '<string>',
'contact' => '<string>',
'companyName' => '<string>',
'link' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valid.com/messaging/api/v1/services/onboarding-link"
payload := strings.NewReader("{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valid.com/messaging/api/v1/services/onboarding-link")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valid.com/messaging/api/v1/services/onboarding-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"<string>\",\n \"contact\": \"<string>\",\n \"companyName\": \"<string>\",\n \"link\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "01a150cd-3fbb-710e-889a-4de55ca8d739",
"status": "SENT"
}
{
"code": "VALIDATION_ERROR",
"message": "Input validation failed",
"details": [
{ "field": "link", "message": "link must be an https URL" }
]
}
{
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}